<template>
	
	<div>
		
		<div>
			<h2>修改头像</h2>
			
			<img 
			style="width: 10vw;height: 10vw;" 
			v-bind:src=" $ip + '/api/public/showimg/' + $ip " />
			
			
		</div>
		
		<div>
			
			<input type='hidden' v-model="data.pic">

			<p>图片: <input type="file" ref="img"> </p>
			
		</div>
		
	</div>
	
</template>



<script setup>
	
	import {ref,reactive,onMounted} from 'vue';
	import {$get} from '@/ajax';
	import {$postj} from '@/ajax';
	import myalert from '@/store/index.js';
	
	const data = reactive({
		
		pic:'',
		
	})
	
	function doImg(){
		
		let filex = data.$refs.img.files[0];
		console.log(filex)
		
		$postf("/api/user/img",filex)
		.then((resp)=>{
			console.log("修改成功")
		})
		
	}
	
	
</script>

<style>
</style>
